package com.yaoxuguang.concurrence.threadBase.interrupted;

/**
 * @author yaoxuguang
 * @Title: yao-interview
 * @Package com.yaoxuguang.concurrence.threadBase.interrupted
 * @Description: 测试interrupted()方法
 * @date 2018年12月17日15:02
 */
public class Run {
    public static void main(String[] args) {
        try {
            MyThread myThread = new MyThread();
            myThread.start();
            Thread.sleep(1000);
            myThread.interrupt();
            System.out.println("是否停止1？ ="+myThread.interrupted());
            System.out.println("是否停止2？ ="+myThread.isInterrupted());
        } catch (InterruptedException e) {
            System.out.println("main cathc");
            e.printStackTrace();
        }
        System.out.println("end...");
    }
}
